/*
 * File      : geo_menu.h
 * Change Logs:
 * Date           Author       Notes
 * 2013-07-27    jimmy.lee    first version
 */

#ifndef __GEO_MENU_H__
#define __GEO_MENU_H__

#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/window.h>
#include "geo_items.h"

struct geo_menu_item
{
	char *text;
	rt_bool_t (*action)(struct rtgui_object *object, void *args);
	void *parameter;
};
DECLARE_TAG(geo_menu_item);
DECLARE_CLASS_TYPE(geomenu);
// Gets the type of a menu
#define GEO_MENU_TYPE      (RTGUI_TYPE(geomenu))
// Casts the object to a menu
#define GEO_MENU(obj)      (RTGUI_OBJECT_CAST((obj), GEO_MENU_TYPE, geo_menu_t))
// Checks if the object is a menu
#define IS_GEO_MENU(obj)   (RTGUI_OBJECT_CHECK_TYPE((obj), GEO_MENU_TYPE))

struct geo_menu
{
	struct rtgui_widget parent;
	struct geo_items *items;
	geo_controller_t controller;
	struct rtgui_win *parent_win;
};
typedef struct geo_menu geo_menu_t;

geo_menu_t *geo_menu_create(rtgui_rect_t *rect, geo_items_t *items);	// geo_controller_t controller)
void geo_menu_destroy(geo_menu_t *menu);
rt_bool_t geo_menu_controller(struct rtgui_object *object, int cmd, void *args);
rt_bool_t geo_menu_event_handler(struct rtgui_object *object, struct rtgui_event *event);
// rt_bool_t geo_menu_on_show(struct rtgui_object *object, void *args);
// rt_bool_t geo_menu_on_pop(struct rtgui_object *object, void *args);
// rt_bool_t geo_menu_on_close(struct rtgui_object *object, void *args);

#endif

